﻿Imports Hinshelwood.TFSStickyBuddy.Infrastructure
Imports Microsoft.Practices.Composite.Events
Imports Microsoft.Practices.Composite.Wpf.Events

Public Class ShellPresenter
    Implements IShellPresenter

    Private m_View As IShellView
    Private m_eventAggregator As IEventAggregator

    Public ReadOnly Property View() As IShellView Implements IShellPresenter.View
        Get
            Return m_View
        End Get
    End Property

    Public Sub New(ByVal view As IShellView, ByVal eventAggregator As IEventAggregator)
        m_View = view
        m_eventAggregator = eventAggregator
        Dim niEvent As Events.NotImplementedEvent = m_eventAggregator.GetEvent(Of Events.NotImplementedEvent)()
        niEvent.Subscribe(AddressOf NotImplementedEventHandler, ThreadOption.UIThread, True)
    End Sub

    Public Sub NotImplementedEventHandler(ByVal p As Events.NotImplementedPayload)
        View.ShowNotImplementedPopup(p.ToString)
    End Sub


End Class
